package com.song.api.controller.admin;

import com.song.grace.result.GraceJSONResult;
import com.song.pojo.bo.AdminLoginBO;
import com.song.pojo.bo.NewAdminBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

@Api(value = "管理员维护", tags = {"管理员维护controller"})
@RequestMapping("adminMng")
public interface AdminMngControllerApi {

    @PostMapping("adminLogin")
    @ApiOperation(value = "管理员登录", notes = "管理员登录", httpMethod = "POST")
    public GraceJSONResult adminLogin(@RequestBody AdminLoginBO adminLoginBO,
                                      HttpServletRequest request,
                                      HttpServletResponse response);

    @PostMapping("adminIsExist")
    @ApiOperation(value = "查询管理人员是否存在", notes = "查询管理人员是否存在", httpMethod = "POST")
    public GraceJSONResult adminIsExist(@RequestParam String username);

    @PostMapping("addNewAdmin")
    @ApiOperation(value = "添加新的管理员", notes = "添加新的管理员", httpMethod = "POST")
    public GraceJSONResult addNewAdmin(@RequestBody @Valid NewAdminBO newAdminBO,
                                       HttpServletRequest request,
                                       HttpServletResponse response);

    @PostMapping("getAdminList")
    @ApiOperation(value = "查询管理人员列表", notes = "查询管理人员列表", httpMethod = "POST")
    public GraceJSONResult getAdminList(@ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                                        @RequestParam Integer page,
                                        @ApiParam(name = "pageSize", value = "分页的每一页显示的条数", required = false)
                                        @RequestParam Integer pageSize);

    @PostMapping("adminLogout")
    @ApiOperation(value = "admin退出登录", notes = "admin退出登录", httpMethod = "POST")
    public GraceJSONResult adminLoguot(@RequestParam String adminId,
                                       HttpServletRequest request,
                                       HttpServletResponse response);

    @PostMapping("adminFaceLogin")
    @ApiOperation(value = "admin用户人脸登录", notes = "admin用户人脸登录", httpMethod = "POST")
    public GraceJSONResult adminFaceLogin(@RequestBody AdminLoginBO adminLoginBO,
                                       HttpServletRequest request,
                                       HttpServletResponse response);
}

